import {http} from "@/api/index";

const movie = {
    getAllMovie:'/movie/findAll',
    addMovie:'/movie/add',
    deleteMovieById:'/movie/delete',
    updateMovie:'/movie/update',
    findMovieType:'/movie/findMovieType',
    findMovieArea:'/movie/findMovieArea',
    findMoviePicList:'/movie/movieResList',
    deleteMoviePic:'/movie/deleteMovieRes',
    queryMovieLike:'/movie/queryMovieLike'
}


export const getAllMovie = (params)=>{
    return http.request({
        url:movie.getAllMovie,
        method:'get',
        params: params
    })
}
export const queryMovieLike = (param)=>{
    return http.request({
        url:movie.queryMovieLike,
        method:'get',
        params: {
            movieLike:param
        }
    })
}
export const findAllMovieType = ()=>{
    return http.request({
        url:movie.findMovieType,
        method:'get'
    })
}
export const findMovieArea = ()=>{
    return http.request({
        url:movie.findMovieArea,
        method:'get'
    })
}

export const addMovie = (params)=>{
    return http.request({
        url:movie.addMovie,
        method:'post',
        data:params
    })
}
export const deleteMovieById = (movieId)=>{
    return http.request({
        url:movie.deleteMovieById,
        method:'get',
        params:{
            movieId:movieId
        }
    })
}
export const updateMovie = (params)=>{
    return http.request({
        url:movie.updateMovie,
        method:'post',
        data:params
    })
}
export const findMoviePicList = (movieId,type)=>{
    return http.request({
        url:movie.findMoviePicList,
        method:'get',
        params:{
            movieId,
            type
        }
    })
}

export const deleteMoviePic = (movieId,fileName,type)=>{
    return http.request({
        url:movie.deleteMoviePic,
        method:'get',
        params:{
            movieId,
            fileName,
            type
        }
    })
}
